<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddFieldToUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('user', function (Blueprint $table) {
            $table->string('client_ip',50)->nullable()->default('')->comment('客户IP');
            $table->string('app_channel')->nullable()->default('')->comment('来源');
            $table->string('osversion')->nullable()->default('')->comment('客户端APP操作系统版本');
            $table->string('device_code')->nullable()->default('')->comment('唯一设备号');
            $table->string('avatar',200)->nullable()->default('')->comment('头像');
            $table->string('unionid',100)->nullable()->default('')->comment('微信唯一标识');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('user', function (Blueprint $table) {
            $table->dropColumn(['client_ip','app_channel','osversion','device_code']);
        });
    }
}
